package com.chushouya.common.shunfeng;


import com.general.framework.core.enums.IEnum;

import java.util.Objects;

public enum SFContactTypeEnum implements IEnum<Integer> {
    //寄件人
    SENDER(1, "寄件人"),
    //收件人
    RECEIVER(2, "收件人"),
    ;

    private Integer type;

    private String name;

    SFContactTypeEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    @Override
    public Integer value() {
        return this.type;
    }

    @Override
    public String named() {
        return this.name;
    }

    public static String getName(Integer type) {
        for (SFContactTypeEnum thisEnum : SFContactTypeEnum.values()) {
            if (Objects.equals(thisEnum.type, type)) {
                return thisEnum.name;
            }
        }
        return "";
    }
}
